<template>
  <div class="custom-form">
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
        :key="showFormKey" v-if="showForm">
        <el-col :span="24" __isOnlyLookInput__="hasLookFormPermission('field110c3ce')">
          <el-form-item label-width="0" prop="field110c3ce">
            <h2 align='center' style="color:undefined;font-size: 16px;text-align: left"
              :style="{width: '100%'}">企业信息</h2>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_FirmName')">
          <el-form-item :label="$t('企业名称')" prop="F_FirmName">
            <el-input v-model="formData['F_FirmName']" placeholder="请输入企业名称"
              __isDisabled__="hasDisabledPermission('F_FirmName',false)"
              __isReadonly__="!hasEditPermission('F_FirmName',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_FirmLogo')">
          <el-form-item :label="$t('企业logo')" prop="F_FirmLogo">
            <xjr-custom-upload :config="F_FirmLogoConfig"
              __isDisabled__="hasDisabledPermission('F_FirmLogo',false)" v-model="formData['F_FirmLogo']"
              list-type="picture-card"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24"> 
          <el-form-item :label="$t('统一社会信用代码')" prop="F_CreditCode">
            <el-input v-model="formData['F_CreditCode']" placeholder="请输入统一社会信用代码"
              :disabled="true" :readonly="true" :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_PlaceOfRegistration')">
          <el-form-item :label="$t('单位登记所在地')" prop="F_PlaceOfRegistration">
            <avue-select-area v-if="showForm" v-model="formData['F_PlaceOfRegistration']" :clearable="true"
              __isDisabled__="hasDisabledPermission('F_PlaceOfRegistration',false)"
              __isReadonly__="!hasEditPermission('F_PlaceOfRegistration',undefined)"></avue-select-area>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_BusinessLicense')">
          <el-form-item :label="$t('企业营业执照')" prop="F_BusinessLicense">
            <xjr-custom-upload :config="F_BusinessLicenseConfig"
              __isDisabled__="hasDisabledPermission('F_BusinessLicense',false)" v-model="formData['F_BusinessLicense']"
              list-type="picture-card"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isOnlyLookInput__="hasLookFormPermission('field111a462')">
          <el-form-item label-width="0" prop="field111a462">
            <h2 align='center' style="color:undefined;font-size: 16px;text-align: left"
              :style="{width: '100%'}">法人信息</h2>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_LegalPersonName')">
          <el-form-item :label="$t('法人姓名')" prop="F_LegalPersonName">
            <el-input v-model="formData['F_LegalPersonName']" placeholder="请输入法人姓名"
              __isDisabled__="hasDisabledPermission('F_LegalPersonName',false)"
              __isReadonly__="!hasEditPermission('F_LegalPersonName',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_LegalPersonCertificateType')">
          <el-form-item :label="$t('法人证件类型')" prop="F_LegalPersonCertificateType">
            <el-select v-model="formData['F_LegalPersonCertificateType']" placeholder="请选择法人证件类型"
              __isDisabled__="hasDisabledPermission('F_LegalPersonCertificateType',false)" filterable clearable
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in F_LegalPersonCertificateTypeOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_LegalPersonCertificateNum')">
          <el-form-item :label="$t('证件号码')" prop="F_LegalPersonCertificateNum">
            <el-input v-model="formData['F_LegalPersonCertificateNum']" placeholder="请输入证件号码"
              __isDisabled__="hasDisabledPermission('F_LegalPersonCertificateNum',false)"
              __isReadonly__="!hasEditPermission('F_LegalPersonCertificateNum',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_LegalPersonPhone')">
          <el-form-item :label="$t('法人手机号')" prop="F_LegalPersonPhone">
            <el-input v-model="formData['F_LegalPersonPhone']" placeholder="请输入法人手机号"
              __isDisabled__="hasDisabledPermission('F_LegalPersonPhone',false)"
              __isReadonly__="!hasEditPermission('F_LegalPersonPhone',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('F_LegalPersonEmail')">
          <el-form-item :label="$t('法人邮箱')" prop="F_LegalPersonEmail">
            <el-input v-model="formData['F_LegalPersonEmail']" placeholder="请输入法人邮箱"
              __isDisabled__="hasDisabledPermission('F_LegalPersonEmail',false)"
              __isReadonly__="!hasEditPermission('F_LegalPersonEmail',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
        	<el-form-item size="large" v-if="isEdit" class="form-button-center">
        		<el-button type="primary" @click="submitForm" :loading="submitLoading" style="background-color: #409EFF;color: #fff;">
        			{{submitLoading?$t('workFlow.WFMenu.hintSubmit'):$t('submit')}}
        		</el-button>
        		<el-button @click="cancelForm">{{$t('cancelText')}}</el-button>
        	</el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
	import workflowFormAuthorize from "@/mixins/workflowFormAuthorize";
	import authorizeMixin from "@/mixins/authorize";
	import nodeMsgMixin from "@/mixins/nodeMsg";
	import { baseUrl } from "@/config/env";
	import request from "@/router/axios";
	import { formValidateNotice } from '@/util/util';		
	import store from "@/store";
	import hideComponentsMixin from "@/mixins/hideComponents"; // 隐藏组件
export default {
  components: {},
  props: ['keyValue', 'isEdit', 'disabled'],
  data() {
    return {
      userInfo: {},
      submitLoading: false,
      showForm: true,
      showFormKey: 1,
      reRenderSubform: false,
      operationVal: 'add',
      isAdd: true,
      //_FORM_ADDRESS_URL_,
      autoCompleteConfEventData: [],
      mainTableName: 'table0',
      formConfig: {},
      formFieldsMap: new Map(),
      hideComponentsMap: new Map(),
      needShowValueTags: ['asso-popup', 'mutiple-popup'],
      formData: {
        'F_FirmName': '',
        'F_FirmLogo': null,
        'F_CreditCode': '',
        'F_PlaceOfRegistration': "",
        'F_BusinessLicense': null,
        'F_LegalPersonName': '',
        'F_LegalPersonCertificateType': '',
        'F_LegalPersonCertificateNum': '',
        'F_LegalPersonPhone': '',
        'F_LegalPersonEmail': '',
      },
      rules: {
        F_FirmName: [{
          required: true,
          message: '请输入企业名称',
          trigger: 'blur'
        }],
        F_FirmLogo: [{
          required: true,
          message: '企业logo不能为空',
          trigger: 'change'
        }],
        F_CreditCode: [],
        F_PlaceOfRegistration: [{
          required: true,
          message: '请选择单位登记所在地',
          trigger: 'change'
        }],
        F_BusinessLicense: [{
          required: true,
          message: '企业营业执照不能为空',
          trigger: 'change'
        }],
        F_LegalPersonName: [{
          required: true,
          message: '请输入法人姓名',
          trigger: 'blur'
        }],
        F_LegalPersonCertificateType: [{
          required: true,
          message: '请选择法人证件类型',
          trigger: 'change'
        }],
        F_LegalPersonCertificateNum: [{
          required: true,
          message: '请输入证件号码',
          trigger: 'blur'
        }],
        F_LegalPersonPhone: [{
          required: true,
          message: '请输入法人手机号',
          trigger: 'blur'
        }, {
          pattern: /^((1[3,5,8,7,9][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\d{8}$/,
          message: '请输入正确的手机号',
          trigger: 'blur'
        }],
        F_LegalPersonEmail: [{
          required: true,
          message: '请输入法人邮箱',
          trigger: 'blur'
        }],
      },
      F_FirmLogoConfig: {
        "showTip": true,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false,
        "accept": ".jpg, .jpeg, .png",
        "multiple": false,
      },
      F_BusinessLicenseConfig: {
        "showTip": true,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false,
        "accept": ".jpg, .jpeg, .png",
        "multiple": false,
      },
      F_LegalPersonCertificateTypeOptions: [],
    }
  },
  computed: {},
  watch: {},
  async created() {
	  this.getFormData2();
    this.formConfig = this.getFormConfig();
    this.formFieldsMap = this.getFormFieldsMap();
    this.userInfo = localStorage.getItem("avue-userInfo") ? JSON.parse(localStorage.getItem(
      "avue-userInfo")).content : {};
  },
  async mounted() {
    this.hideComponentsMap = await this.getHideComponentsMap();
    this.showForm = false;
    await this.insertCreatedEvent();
    //TODO   再这里做数据回填 请求表单数据
    //用于占位
	
    if (typeof this.getField106Options == "function") {
      await this.getField106Options();
    }
    await this.insertMountedEvent();
    this.reRenderSubform = true; //子表单显示
    this.showFormKey++;
    this.processParameterAssignment();
    this.showForm = true;
  },
  methods: {
    getFormData() {
      let key = 'xjrBaseUserDto';
      let returnParams = {};
      returnParams = this.formData;
      return {
        ...returnParams,
      };
    },
	getFormData2() {
		axios({
				url: baseUrl + '/t_barin_user_registration/' + localStorage.getItem('fuserid'),
				method: 'get',
			}).then(res => {
				this.formData = res.data.data;
	
			})
			.catch(error => {
				console.error('数据异常!', error);
			});
	},
    validateForm() {
      this.$refs['elForm'].validate(valid => {});
    },
    async aysncValidateForm() {
      let validataArry = []
      let formValidateNotice = function formValidateNotice(obj, that, formAuth) {
        for (var o in obj) {
          if (!formAuth[o] && obj[o][0]) {
            that.$message({
              message: obj[o][0].message + ',' + that.$t('noFormAuth'),
              type: 'warning'
            });
            return;
          }
        }
      }
      validataArry.push(new Promise((resolve, reject) => {
        this.$refs['elForm'].validate((valid, object) => {
          if (!this.isWorkflowForm) formValidateNotice(object, this, this.formEnCodeList)
          resolve(valid)
        })
      }))
      let res = await Promise.all(validataArry)
      if (res.includes(false)) {
        return false
      }
      else {
        return true;
      }
    },
    changeTableData() {},
    async submitForm() {
      this.submitLoading = true;
      let valid = await this.aysncValidateForm();
      if (valid == false) {
        this.submitLoading = false;
        return false;
      }
      this.changeTableData();
      //格式化数据
      let newObj = this.getFormData();
          request({
            url: baseUrl + "/t_barin_user_registration/" + localStorage.getItem('fuserid'),
            method: "put",
            data : newObj
          }).then((res) => {
            this.submitLoading = false;
            this.$notify({
              title: "成功",
              message: "修改成功",
              type: "success",
            });
             this.$emit("onChange",true)
          });
      await this.handleSubmit();
    },
    cancelForm() {
      this.$emit("onChange", true)
    },
    formatTree(data, valueField, lableField, childField, type) {
      let tree = [];
      data.forEach((node, index) => {
        let newNode = {
          value: node[valueField],
          label: node[lableField],
        };
        if (type) {
          newNode.disabled = node[valueField] == undefined ? true : false
        }
        tree.push(newNode);
        if (node[childField] != null && node[childField].length > 0) {
          newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
          type));
        }
      }, this);
      return tree;
    },
    //__WORKFLOWFORMHANDLEMETHODS__
    //FORM_EVENT_EDIT
    //__SUMIBTHANDLEMETHODS__
    async getField106Options() {
      // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
      try {
        let resp = await this.$axios({
          method: 'get',
          url: baseUrl + '/data-items/CertificateType/detail',
        });
        if (resp.data.data) {
          this.F_LegalPersonCertificateTypeOptions = resp.data.data;
        }
      }
      catch (error) {}
    },
    async triggerEventHandler(eventData) {
      if (eventData.length > 0) {
        eventData.forEach(ele => {
          let functionName = 'getField' + ele.componentFormId + 'Options';
          if (typeof this[functionName] == "function") {
            this[functionName]();
          }
        })
      }
    },
    triggerEventFormIdHandler(formId) {
      if (this.formFieldsMap.get(formId).__config__.triggerEvents && this.formFieldsMap.get(formId).__config__
        .triggerEvents.length > 0) {
        this.formFieldsMap.get(formId).__config__.triggerEvents.forEach(triggerEventItem => {
          if (this.formFieldsMap.get(formId).__config__.triggerEventData && this.formFieldsMap.get(formId)
            .__config__.triggerEventData[triggerEventItem] && this.formFieldsMap.get(formId).__config__
            .triggerEventData[triggerEventItem].length > 0) {
            this.triggerEventHandler(this.formFieldsMap.get(formId).__config__.triggerEventData[
              triggerEventItem]);
          }
        });
      }
      return true;
    },
    //清空联想弹层、多选弹层的值
    clearBombLayerFormData(filed) {
      this.formData[filed] = '';
      this.formData[filed + '_showValue'] = '';
    },
    // 流程参数赋值
    processParameterAssignment() {
      // 流程中的流程参数赋值 优先级最高，最后赋值
      setTimeout(() => {
        if (this.isEdit != 2 && this.parameter && this.parameter[this.mainTableName]) {
          this.showForm = false;
          for (let [key, value] of Object.entries(this.parameter[this.mainTableName])) {
            this.setFormDataValue(key, value);
          }
          this.showForm = true;
        }
      }, 0);
    },
    setFormDataValue(field, val) {
      if (Array.isArray(this.formData[field])) {
        if (val.includes(',')) {
          this.formData[field] = val.split(',');
        }
        else {
          this.formData[field] = [val];
        }
      }
      else {
        this.formData[field] = val;
      }
      //处理联想弹层，多选弹层
      if (this.formData[field + '_showValue'] != undefined) {
        this.formData[field + '_showValue'] = val;
      }
    },
    setOutputsValue(nodeType, formId, res, outputKey) {
      let nodeTypeChecked = false;
      if (nodeType == 'created') {
        nodeTypeChecked = this.operationVal == 'add';
      }
      else if (nodeType == 'edit') {
        nodeTypeChecked = this.operationVal == 'edit';
      }
      else if (nodeType == 'mounted') {
        nodeTypeChecked = this.operationVal == 'add' || this.operationVal == 'edit';
      }
      if (nodeTypeChecked && this.disabled != true && res && res.data && res.data.data && this.formFieldsMap
        .has(formId) && this.formFieldsMap.get(formId).__vModel__ && this.formData.hasOwnProperty(this
          .formFieldsMap.get(formId).__vModel__)) {
        this.setFormDataValue(this.formFieldsMap.get(formId).__vModel__, res.data.data[outputKey]);
        // 联想弹层 多选弹层 特殊处理
        if (this.formFieldsMap.get(formId).__config__ && this.formFieldsMap.get(formId).__config__.avueType &&
          this.needShowValueTags.includes(this.formFieldsMap.get(formId).__config__.avueType)) {
          this.formData[this.formFieldsMap.get(formId).__vModel__ + '_showValue'] = res.data.data[outputKey];
        }
        this.triggerEventFormIdHandler(formId);
      }
    },
    //子表单权限
    getAuthorityTableChildrenList(bindTable, children) {
      let column = [];
      if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
        let formSubEnCodeList = this.formEnCodeList[bindTable];
        if (children && children.length > 0) {
          column = children.map(ele2 => {
            if (formSubEnCodeList.includes(ele2.prop)) {
              ele2.hide = false;
            }
            else {
              ele2.hide = true;
            }
            if (ele2.hide == false) {
              //工作流中系统表单必填权限
              if (this.formSubTableNotRequiredList && this.formSubTableNotRequiredList[bindTable] !=
                undefined) {
                if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
                  ele2.required = false;
                }
                else {
                  ele2.required = true;
                }
              }
              ele2.rules = [];
              if (ele2.required) {
                ele2.rules = ele2.ruleList;
              }
              // disabled 属性
              if (this.formSubTableDisabledList && this.formSubTableDisabledList[bindTable] !=
                undefined) {
                if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
                  ele2.disabled = true;
                }
                else {
                  ele2.disabled = false;
                }
              }
              if (this.disabled) { //查看
                ele2.disabled = true;
              }
            }
            else {
              ele2.rules = []
              if (ele2.required) {
                ele2.ruleList.forEach(el => {
                  el.message += ',' + this.$t('noFormAuth')
                })
                ele2.rules = ele2.ruleList;
              }
            }
            return ele2;
          });
        }
        return column;
      }
      else {
        return children;
      }
    },
    async insertCreatedEvent() {
      //FORM_EVENT_CREATED
    },
    async insertMountedEvent() {
      //FORM_EVENT_MOUNTED
    },
    async insertEditEvent() {
      //FORM_EDIT_STR
    },
    async insertSubmitEvent() {
      //FORM_SUBMIT_STR
    },
    getFormConfig() {
      //FORM_CONFIG_START
      let config = {
        "fields": [{
          "__config__": {
            "label": "企业信息",
            "changeTag": null,
            "isBindTable": false,
            "showLabel": false,
            "titlePosition": "left",
            "titleColor": null,
            "fontSize": 16,
            "tag": "h2",
            "tagIcon": "title",
            "span": 24,
            "align": "top",
            "justify": "start",
            "layout": "colFormItem",
            "document": "https://element.eleme.cn/#/zh-CN/component/button",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 110,
            "renderKey": "1101716258595250"
          },
          "__slot__": {},
          "__vModel__": "field110c3ce"
        }, {
          "__config__": {
            "label": "企业名称",
            "labelWidth": null,
            "showLabel": true,
            "changeTag": true,
            "tag": "el-input",
            "tagIcon": "input",
            "avueType": "input-tip",
            "required": true,
            "layout": "colFormItem",
            "span": 24,
            "document": "https://element.eleme.cn/#/zh-CN/component/input",
            "F_LgMarkCode": "",
            "regList": [],
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "prestrainField": "",
            "formId": 100,
            "renderKey": "1001716258508007"
          },
          "__slot__": {
            "prepend": "",
            "append": ""
          },
          "placeholder": "请输入企业名称",
          "style": {
            "width": "100%"
          },
          "clearable": true,
          "prefix-icon": "",
          "suffix-icon": "",
          "maxlength": null,
          "show-word-limit": false,
          "readonly": false,
          "disabled": false,
          "__vModel__": "F_FirmName"
        }, {
          "__config__": {
            "label": "企业logo",
            "tag": "el-upload",
            "tagIcon": "upload",
            "avueType": "upload",
            "layout": "colFormItem",
            "defaultValue": null,
            "showLabel": true,
            "labelWidth": null,
            "required": true,
            "span": 24,
            "showTip": true,
            "buttonText": "点击上传",
            "regList": [],
            "changeTag": true,
            "fileSize": 2,
            "sizeUnit": "MB",
            "document": "https://element.eleme.cn/#/zh-CN/component/upload",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 101,
            "renderKey": "1011716258521135"
          },
          "__slot__": {
            "list-type": true
          },
          "action": "http://172.16.39.12:2828/upload",
          "disabled": false,
          "accept": "",
          "name": "file",
          "auto-upload": true,
          "list-type": "picture-card",
          "multiple": false,
          "__vModel__": "F_FirmLogo"
        }, {
          "__config__": {
            "label": "统一社会信用代码",
            "labelWidth": null,
            "showLabel": true,
            "changeTag": true,
            "tag": "el-input",
            "tagIcon": "input",
            "avueType": "input-tip",
            "required": false,
            "layout": "colFormItem",
            "span": 24,
            "document": "https://element.eleme.cn/#/zh-CN/component/input",
            "F_LgMarkCode": "",
            "regList": [],
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "prestrainField": "",
            "formId": 102,
            "renderKey": "1021716258540220"
          },
          "__slot__": {
            "prepend": "",
            "append": ""
          },
          "placeholder": "请输入统一社会信用代码",
          "style": {
            "width": "100%"
          },
          "clearable": false,
          "prefix-icon": "",
          "suffix-icon": "",
          "maxlength": null,
          "show-word-limit": false,
          "readonly": true,
          "disabled": false,
          "__vModel__": "F_CreditCode"
        }, {
          "__config__": {
            "label": "单位登记所在地",
            "url": "",
            "method": "get",
            "dataKey": "list",
            "showLabel": true,
            "labelWidth": null,
            "tag": "avue-select-area",
            "tagIcon": "cascader",
            "avueType": "select-area",
            "layout": "colFormItem",
            "defaultValue": "",
            "span": 24,
            "required": true,
            "regList": [],
            "changeTag": true,
            "document": "https://element.eleme.cn/#/zh-CN/component/cascader",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 103,
            "renderKey": "1031716258551950"
          },
          "placeholder": "请选择单位登记所在地",
          "style": {
            "width": "100%"
          },
          "show-all-levels": true,
          "disabled": false,
          "clearable": true,
          "filterable": false,
          "separator": "/",
          "__vModel__": "F_PlaceOfRegistration"
        }, {
          "__config__": {
            "label": "企业营业执照",
            "tag": "el-upload",
            "tagIcon": "upload",
            "avueType": "upload",
            "layout": "colFormItem",
            "defaultValue": null,
            "showLabel": true,
            "labelWidth": null,
            "required": true,
            "span": 24,
            "showTip": false,
            "buttonText": "点击上传",
            "regList": [],
            "changeTag": true,
            "fileSize": 2,
            "sizeUnit": "MB",
            "document": "https://element.eleme.cn/#/zh-CN/component/upload",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 104,
            "renderKey": "1041716258556182"
          },
          "__slot__": {
            "list-type": true
          },
          "action": "http://172.16.39.12:2828/upload",
          "disabled": false,
          "accept": "",
          "name": "file",
          "auto-upload": true,
          "list-type": "picture-card",
          "multiple": false,
          "__vModel__": "F_BusinessLicense"
        }, {
          "__config__": {
            "label": "法人信息",
            "changeTag": null,
            "isBindTable": false,
            "showLabel": false,
            "titlePosition": "left",
            "titleColor": null,
            "fontSize": 16,
            "tag": "h2",
            "tagIcon": "title",
            "span": 24,
            "align": "top",
            "justify": "start",
            "layout": "colFormItem",
            "document": "https://element.eleme.cn/#/zh-CN/component/button",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 111,
            "renderKey": "1111716258634914"
          },
          "__slot__": {},
          "__vModel__": "field111a462"
        }, {
          "__config__": {
            "label": "法人姓名",
            "labelWidth": null,
            "showLabel": true,
            "changeTag": true,
            "tag": "el-input",
            "tagIcon": "input",
            "avueType": "input-tip",
            "required": true,
            "layout": "colFormItem",
            "span": 24,
            "document": "https://element.eleme.cn/#/zh-CN/component/input",
            "F_LgMarkCode": "",
            "regList": [],
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "prestrainField": "",
            "formId": 105,
            "renderKey": "1051716258563732"
          },
          "__slot__": {
            "prepend": "",
            "append": ""
          },
          "placeholder": "请输入法人姓名",
          "style": {
            "width": "100%"
          },
          "clearable": true,
          "prefix-icon": "",
          "suffix-icon": "",
          "maxlength": null,
          "show-word-limit": false,
          "readonly": false,
          "disabled": false,
          "__vModel__": "F_LegalPersonName"
        }, {
          "__config__": {
            "label": "法人证件类型",
            "showLabel": true,
            "labelWidth": null,
            "tag": "el-select",
            "tagIcon": "select",
            "avueType": "select",
            "layout": "colFormItem",
            "span": 24,
            "required": true,
            "regList": [],
            "changeTag": true,
            "dataType": "dataItem",
            "saveField": "",
            "showField": "",
            "document": "https://element.eleme.cn/#/zh-CN/component/select",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 106,
            "renderKey": "1061716258569466",
            "apiConfig": {
              "url": "",
              "type": "",
              "dataSorce": "",
              "dataSorceList": [],
              "dataSourceFieldOption": [],
              "showField": "",
              "saveField": "",
              "apiInputParams": [],
              "F_UrlAddress": ""
            },
            "dataItem": "CertificateType"
          },
          "__slot__": {
            "options": [{
              "label": "护照",
              "value": "0"
            }, {
              "label": "身份证",
              "value": "1"
            }, {
              "label": "港澳台通行证",
              "value": "2"
            }]
          },
          "placeholder": "请选择法人证件类型",
          "style": {
            "width": "100%"
          },
          "clearable": true,
          "disabled": false,
          "filterable": true,
          "multiple": false,
          "__vModel__": "F_LegalPersonCertificateType"
        }, {
          "__config__": {
            "label": "证件号码",
            "labelWidth": null,
            "showLabel": true,
            "changeTag": true,
            "tag": "el-input",
            "tagIcon": "input",
            "avueType": "input-tip",
            "required": true,
            "layout": "colFormItem",
            "span": 24,
            "document": "https://element.eleme.cn/#/zh-CN/component/input",
            "F_LgMarkCode": "",
            "regList": [],
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "prestrainField": "",
            "formId": 107,
            "renderKey": "1071716258572432"
          },
          "__slot__": {
            "prepend": "",
            "append": ""
          },
          "placeholder": "请输入证件号码",
          "style": {
            "width": "100%"
          },
          "clearable": true,
          "prefix-icon": "",
          "suffix-icon": "",
          "maxlength": null,
          "show-word-limit": false,
          "readonly": false,
          "disabled": false,
          "__vModel__": "F_LegalPersonCertificateNum"
        }, {
          "__config__": {
            "label": "法人手机号",
            "labelWidth": null,
            "showLabel": true,
            "changeTag": true,
            "tag": "el-input",
            "tagIcon": "input",
            "avueType": "input-tip",
            "required": true,
            "layout": "colFormItem",
            "span": 24,
            "document": "https://element.eleme.cn/#/zh-CN/component/input",
            "F_LgMarkCode": "",
            "regList": [{
              "pattern": "/^((1[3,5,8,7,9][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\\d{8}$/",
              "message": "请输入正确的手机号"
            }],
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "prestrainField": "",
            "formId": 108,
            "renderKey": "1081716258575065"
          },
          "__slot__": {
            "prepend": "",
            "append": ""
          },
          "placeholder": "请输入法人手机号",
          "style": {
            "width": "100%"
          },
          "clearable": true,
          "prefix-icon": "",
          "suffix-icon": "",
          "maxlength": null,
          "show-word-limit": false,
          "readonly": false,
          "disabled": false,
          "__vModel__": "F_LegalPersonPhone"
        }, {
          "__config__": {
            "label": "法人邮箱",
            "labelWidth": null,
            "showLabel": true,
            "changeTag": true,
            "tag": "el-input",
            "tagIcon": "input",
            "avueType": "input-tip",
            "required": true,
            "layout": "colFormItem",
            "span": 24,
            "document": "https://element.eleme.cn/#/zh-CN/component/input",
            "F_LgMarkCode": "",
            "regList": [],
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "prestrainField": "",
            "formId": 109,
            "renderKey": "1091716258577990"
          },
          "__slot__": {
            "prepend": "",
            "append": ""
          },
          "placeholder": "请输入法人邮箱",
          "style": {
            "width": "100%"
          },
          "clearable": true,
          "prefix-icon": "",
          "suffix-icon": "",
          "maxlength": null,
          "show-word-limit": false,
          "readonly": false,
          "disabled": false,
          "__vModel__": "F_LegalPersonEmail"
        }]
      };
      return config;
      //FORM_CONFIG_END
    },
    getFormFieldsMap() {
      //FORM_CONFIG_MAP_START
      let config = [
        [110, {
          "__vModel__": "field110c3ce",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [100, {
          "__vModel__": "F_FirmName",
          "__config__": {
            "avueType": "input-tip",
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "autoHandlerConfig": null
          }
        }],
        [101, {
          "__vModel__": "F_FirmLogo",
          "__config__": {
            "avueType": "upload",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [102, {
          "__vModel__": "F_CreditCode",
          "__config__": {
            "avueType": "input-tip",
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "autoHandlerConfig": null
          }
        }],
        [103, {
          "__vModel__": "F_PlaceOfRegistration",
          "__config__": {
            "avueType": "select-area",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [104, {
          "__vModel__": "F_BusinessLicense",
          "__config__": {
            "avueType": "upload",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [111, {
          "__vModel__": "field111a462",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [105, {
          "__vModel__": "F_LegalPersonName",
          "__config__": {
            "avueType": "input-tip",
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "autoHandlerConfig": null
          }
        }],
        [106, {
          "__vModel__": "F_LegalPersonCertificateType",
          "__config__": {
            "avueType": "select",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [107, {
          "__vModel__": "F_LegalPersonCertificateNum",
          "__config__": {
            "avueType": "input-tip",
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "autoHandlerConfig": null
          }
        }],
        [108, {
          "__vModel__": "F_LegalPersonPhone",
          "__config__": {
            "avueType": "input-tip",
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "autoHandlerConfig": null
          }
        }],
        [109, {
          "__vModel__": "F_LegalPersonEmail",
          "__config__": {
            "avueType": "input-tip",
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "autoHandlerConfig": null
          }
        }]
      ];
      return new Map(config);
      //FORM_CONFIG_MAP_END
    },
    async getHideComponentsMap() {
      let mapList = new Map();
      let hideComponentList = this.getHideComponents();
      if (typeof this.initHideComponentList == 'function') {
        mapList = await this.initHideComponentList(hideComponentList);
        this.$store.commit("SET_HIDE_COMPONENT_LIST", mapList);
      }
      return mapList;
    },
    getHideComponentsMapItem(key) {
      if (this.hideComponentsMap.size > 0) {
        return this.hideComponentsMap.has(key) ? this.hideComponentsMap.get(key) : "";
      }
      else {
        return ""
      }
    },
    getHideComponents() {
      //FORM_HIDE_COMPONENTS_START
      let config = [];
      return config;
      //FORM_HIDE_COMPONENTS_END
    },
  }
}

</script>
<style>
.el-table__empty-block {
  width: 100% !important;
}

.avue-form__row {
  padding: 0 !important;
}

#editorphone {
  width: 375px;
  margin: 0 auto;
  border: 1px solid #E4E7ED;
  padding: 0 7.5px;
  background: #f5f6fa;
  height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 5px;
}

#editorphone .el-col {
  border-bottom: 1px solid #F2F2F2;
  background: #fff;
  margin-bottom: 0;
  padding: 0 15px 6px !important;
  width: 100%;
}

#editorphone .el-form-item__label {
  line-height: 20px
}

#editorphone .el-input-group .el-input__inner {
  background: #f5f6fa
}

#editorphone .el-input__inner {
  border: 0
}

#editorphone .el-input-group__append,
#editorphone .el-input-group__prepend {
  border: 0;
  background: #edeef2;
  color: #666;
}

#editorphone .el-input-group .el-input__prefix {
  left: 44px
}

#editorphone .el-input-group .el-input__suffix {
  right: 44px
}

#editorphone .el-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-flow: wrap;
}

#editorphone .el-form-item__label {
  float: none;
  min-width: 85px;
  width: auto !important;
  text-align: left;
  flex: auto;
}

#editorphone .tinymce .el-form-item__label {
  min-width: 100%;
}

#editorphone .el-form-item__content {
  margin-left: 0px !important;
  flex: auto;
  width: calc(100% - 95px);
}

#editorphone .avueFormNoLable .el-form-item__label,
#editorphone .avueFormNoLable .avue-crud__pagination {
  display: none;
}

#editorphone .avueFormNoLable .el-collapse-item__wrap,
#editorphone .avueFormNoLable .el-collapse {
  border-bottom: 0
}

#editorphone .avueFormNoLable .el-col {
  border-bottom: 0;
  padding-bottom: 0
}

#editorphone .el-form-item__content .el-button:first-child {
  margin-left: 90px;
}

.el-upload__tip {
  line-height: 1.2;
}

</style>
